﻿using System;
using System.Data;
using System.Web.Configuration;

namespace Model
{
    public abstract class DataAccess
    {
        protected string ConnectionString { get; set; }

        protected DataAccess()
        {
            ConnectionString = 
                WebConfigurationManager.ConnectionStrings["MusicCatalogConnectionString"].ConnectionString;
        }

        public DateTime GetDate(object obj)
        {
            if (obj == Convert.DBNull)
                return new DateTime(1900, 1, 1);
            return (DateTime)obj;
        }
    }
}
